package com.kt.mes.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kt.mes.mapper.WasteStoreMapper;
import com.kt.mes.domain.WasteStore;
import com.kt.mes.service.IWasteStoreService;

/**
 * 废料库Service业务层处理
 * 
 * @author lzc
 * @date 2021-04-19
 */
@Service
public class WasteStoreServiceImpl implements IWasteStoreService 
{
    @Autowired
    private WasteStoreMapper wasteStoreMapper;

    /**
     * 查询废料库
     * 
     * @param id 废料库ID
     * @return 废料库
     */
    @Override
    public WasteStore selectWasteStoreById(Long id)
    {
        return wasteStoreMapper.selectWasteStoreById(id);
    }

    /**
     * 查询废料库列表
     * 
     * @param wasteStore 废料库
     * @return 废料库
     */
    @Override
    public List<WasteStore> selectWasteStoreList(WasteStore wasteStore)
    {
        return wasteStoreMapper.selectWasteStoreList(wasteStore);
    }

    /**
     * 新增废料库
     * 
     * @param wasteStore 废料库
     * @return 结果
     */
    @Override
    public int insertWasteStore(WasteStore wasteStore)
    {
        wasteStore.setCreateTime(DateUtils.getNowDate());
        return wasteStoreMapper.insertWasteStore(wasteStore);
    }

    /**
     * 修改废料库
     * 
     * @param wasteStore 废料库
     * @return 结果
     */
    @Override
    public int updateWasteStore(WasteStore wasteStore)
    {
        wasteStore.setUpdateTime(DateUtils.getNowDate());
        return wasteStoreMapper.updateWasteStore(wasteStore);
    }

    /**
     * 批量删除废料库
     * 
     * @param ids 需要删除的废料库ID
     * @return 结果
     */
    @Override
    public int deleteWasteStoreByIds(Long[] ids)
    {
        return wasteStoreMapper.deleteWasteStoreByIds(ids);
    }

    /**
     * 删除废料库信息
     * 
     * @param id 废料库ID
     * @return 结果
     */
    @Override
    public int deleteWasteStoreById(Long id)
    {
        return wasteStoreMapper.deleteWasteStoreById(id);
    }
}
